<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%-- @author: Christian Baumhof --%>

<%-- Title --%>
<h1>
	<s:text name="title.oralExamOverview" />
</h1>

<%-- Select maniple and if finished exams should be shown --%>
<s:form id="oralExamForm">
	<table class="formTable">
		<tr>
			<td><s:text name="lbl.maniple" /></td>
			<td><s:select theme="simple" name="selectedManipleId"
					list="maniples" listKey="id" listValue="name"
					value="selectedManipleId" /></td>
			<td><s:text name="lbl.showFinishedExams" /></td>
			<td><s:checkbox theme="simple" name="showFinishedExams"
					value="showFinishedExams" /></td>
		</tr>
	</table>

	<%-- Show button --%>
	<table class="formTable">
		<tr>
			<td><s:submit theme="simple" key="button.show"
					action="ShowOralExamOverview" /></td>
		</tr>
	</table>
</s:form>

<%-- Data table --%>
<table>
	<%-- Column headlines --%>
	<tr>
		<th><s:text name="lbl.student" /></th>
		<th><s:text name="lbl.subject" /></th>
		<th><s:text name="lbl.grade" /></th>
		<th><s:text name="lbl.examDate" /></th>
		<th><s:text name="lbl.typist" /></th>
		<th><s:text name="lbl.entryDate" /></th>
		<th>&nbsp;</th>
	</tr>

	<%-- Results --%>
	<s:iterator value="results" status="nrResult">
		<s:form theme="simple">
			<tr>
				<td><s:property value="student.lastName" />, <s:property
						value="student.firstName" /></td>
				<td><s:property value="examination.examinationSubject.title" />
					- <s:property value="examination.examinationSubject.description" /></td>
				<s:if test="!openOralExam[#nrResult.index]">
					<s:iterator value="oralExaminationResults">
						<s:if test="valid">
							<td><s:property value="grade" /></td>
							<td><s:property value="examination.date" /></td>
							<td><s:property value="typist" /></td>
							<td><s:property value="entryDate" /></td>
						</s:if>
					</s:iterator>
				</s:if>
				<s:else>
					<td>-</td>
					<td>-</td>
					<td>-</td>
					<td>-</td>
				</s:else>
				<%-- Edit button --%>
				<td><s:submit theme="simple" key="button.edit"
						action="EditOralExam" /> <s:hidden name="id" /></td>
			</tr>
		</s:form>
	</s:iterator>
</table>






